import os
import time

from PyQt5.QtCore import Qt, QObject, pyqtSignal, QTimer, QItemSelectionModel
from PyQt5.QtWidgets import QWidget, QAbstractItemView, QHeaderView, QMessageBox, QDialog

from utils.global_state import GlobalState
from ui.Ui_page_about_ui import Ui_Form
from utils.config_manager import ConfigManager



class SignalsAbout(QObject):
    aa = pyqtSignal(str, str)
    bb = pyqtSignal(str)


class PageAboutUI(QWidget, Ui_Form):
    def __init__(self):
        # 使用 uic 动态加载 .ui 文件
        super().__init__()
        self.setupUi(self)


class PageAbout(QWidget):
    def __init__(self):
        super(PageAbout, self).__init__()

        self.cur_sel_operation_date = None
        self.cur_sel_well_name = None
        self.__init_instance_var()

        self.__restore_settings()

        # self.init_page_state()

        self.__connect()

    def __init_instance_var(self):
        self.__global_state = GlobalState()
        self.ui = PageAboutUI()
        self.signals = SignalsAbout()

    # 加载文件中的用户设置
    def __restore_settings(self):
        self.__config_man = ConfigManager()

        self.params_home = self.__config_man.get_section("page_home")

        if self.params_home is None:
            print("读取配置文件异常: params_page_data_man")
            # 加载一个默认参数...

        # 把配置文件中，一些需要简单处理，不方便直接使用的参数，处理后加载到成员变量
        else:
            pass

    def __connect(self):
        pass

    def init_page_state(self):
        pass
